//
//  HYOUBaseTableViewCell.m
//  BestGift
//
//  Created by dllo on 15/12/29.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "HYOUBaseTableViewCell.h"

@implementation HYOUBaseTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeColor:) name:@"changeColor" object:nil];
        
        NSString *states = [[NSUserDefaults standardUserDefaults] objectForKey:@"night"];
        if ([states isEqualToString:@"yes"]) {
            self.backgroundColor = NIGHT_COLOR;
        }
        
    }
    return self;
}

-(void)changeColor:(NSNotification *)notification{

    UIColor *color = [notification object];
    self.backgroundColor = color;
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
